<div class="outer-fill shadow padding15">
 <div class="judul-page">Data Magang</div>
<form class="form-inline" role="form" method="post" action="<?php echo site_url($aksi_cari);?>">
    <div class="form-group">
      <label class="sr-only" for="pencarian">Pencarian</label>
      <input type="text" name="judul" class="form-control" value="<?php echo isset($param_judul)?$param_judul:''; ?>" id="judul" placeholder="Pencarian">
    </div>

    <button type="submit" class="btn btn-info btn-sm" id="cari" name="cari">
      <span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;Cari</button>
    <a href="<?php echo site_url('admin_magang/view_add')?>" class="btn btn-success btn-sm pull-right"> 
      <span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;Tambah
    </a>
  </form>
  <br>
  <!-- style table -->
  <table class="table table-striped">
    <thead>
      <tr>
        <th>No</th>
        <th>Peserta</th>
        <th>Tgl Mulai</th>
        <th>Tgl Selesai</th>
        <th>Divisi</th>
        <th>Aksi</th>
      </tr>
    </thead>
    <tbody>
	  <?php 
	  $no=1+$offset;
	  foreach($hasil as $val){
      if($val['id_divisi'] == 1){
        $divisi = "Software and Development";
      }elseif ($val['id_divisi'] == 2) {
        $divisi = "Infrastruktur";
      }else{
        $divisi = "Internet Service Provider";
      }
	  ?>
            <tr>
              <td><?php echo $no?></td>
              <td><?php echo $val['asal_peserta'];?></td>
              <td><?php echo konvert_tgl($val['tgl_mulai']);?></td>
              <td><?php echo konvert_tgl($val['tgl_selesai']);?></td>
              <td><?php echo $divisi;?></td>
              <td>
                <a href="<?php echo site_url('admin_magang/view_edit'."/".$val['id_magang']);?>" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-edit"></span>&nbsp;Edit</a>
                <a onclick="return confirm('Apakah data ingin dihapus ?')" href="<?php echo site_url('admin_magang/delete'."/".$val['id_magang']);?>" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-trash"></span>&nbsp;Hapus</a>
                
              </td>
            </tr>
          
            <?php
		$no++;
		}
		?>
    </tbody>
  </table>
  <!-- end table -->
<?php
echo ! empty($pagination) ? '<center><div class="pagination">' . $pagination . '</div></center>' : '';
?>
</div>